<?php
	header("Content-Type: text/html;charset=utf-8");
	include("../_judge.php");
	include("../../function/function.php");

	$id = chkstr(trim($_REQUEST['id']));
	if(!is_numeric($id)){
		echo erro("ID错误");
	}

	$news_sql = "select * from kboy_admin where id=$id";
	$news_rows = mysql_query($news_sql);
	$news_nums = mysql_num_rows($news_rows);
	if($news_nums > 0){
		$news_rs = mysql_fetch_array($news_rows);
		$admin_title = $news_rs['admin_title'];
		$admin_username = $news_rs['admin_username'];
		$admin_password = $news_rs['admin_password'];
		$admin_power = $news_rs['admin_power'];
	}else{
		echo erro("该信息已经被删除或不存在");
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?= $adminweb_titles ?></title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<script>if (top.location != parent.location||self.location==top.location){top.location.replace('../login/admin.php')}</script>
<script language="javascript" src="../script/jquery-1.7.2.min.js"></script>
<script language="javascript">
$(document).ready(function(){
	$("#myform").submit(function(){
		var admin_password = $("#admin_password").val();
		var admin_repassword = $("#admin_repassword").val();

		if (admin_password.replace(/\ /g,"").length>0){
			if (admin_password.replace(/\ /g,"").length<1){
				alert("密码不能为空！");
				$("#admin_password").focus();
				return false;
			}
			if (admin_password != admin_repassword){
				alert("两次密码输入不一致！");
				$("#admin_repassword").focus();
				return false;
			}
		}
	});
});
</script>


</head>

<body>
<table width="97%" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr>
    <td><strong>后台管理</strong>&nbsp;-&nbsp;<span class="hong"><strong>管理员修改</strong></span></td>
  </tr>

</table>
<form id="myform" name="myform" method="post" action="newsaddsave.php?action=edit">
<table width="97%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#333333">
    <tr>
      <td width="100" align="right" bgcolor="#EFEFEF">管理员角色：</td>
      <td bgcolor="#EFEFEF">
		<input name="admin_title" type="text" id="admin_title" value="<?=$admin_title?>" size="35" />对会员的描述
		<input name="id" type="hidden" id="id" value="<?=$id?>" />
		<input name="re_url" type="hidden" id="re_url" value="<?=$_SERVER['HTTP_REFERER']?>" />
	</td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">管理员用户名：</td>
      <td bgcolor="#EFEFEF"><?=$admin_username?></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">管理员密码：</td>
      <td bgcolor="#EFEFEF"><input name="admin_password" type="password" id="admin_password" value="" size="37" />
        <span class="hong">*不填写为不修改</span></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">重复密码：</td>
      <td bgcolor="#EFEFEF"><input name="admin_repassword" type="password" id="admin_repassword" value="" size="37" />
        <span class="hong">*</span></td>
    </tr>
    <tr>
      <td bgcolor="#EFEFEF">&nbsp;</td>
      <td bgcolor="#EFEFEF"><input type="submit" name="Submit" value="提交保存" />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" name="Submit2" value="重置取消" /></td>
    </tr>
</table>
</form>
</body>
</html>
